package thread;

public class Demo8 {
    public static void main(String[] args) {
        Thread t = new Thread(()->{
            while (true){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }

        },"我的线程");
        t.start();
        System.out.println(t.getId());//12
        System.out.println(t.getName());//我的线程
        System.out.println(t.getState());//TIMED_WAITING
        System.out.println(t.getPriority());//5
        System.out.println(t.isDaemon());//false
        System.out.println(t.isAlive());//true
    }
}
